<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        div {
            width: 200px;
            height: 200px;
            background: red;
        }
    </style>
</head>
<body>
    <div>
        <span>123</span>
    </div>
    <script>
        // click 一般是指 mousedown 和 mouseup作用于同一元素
        // 同一次操作中的 mousedown 和 mouseup 可以不作用于同一元素
        const div = document.querySelector('div');
        div.addEventListener('click', function(ev) {
            console.log('click', ev.target);
        });
        div.addEventListener('mousedown', function(ev) {
            console.log('mousedown', ev.target);
        });
        div.addEventListener('mouseup', function(ev) {
            console.log('mouseup', ev.target);
        })
    </script>
</body>
</html>